Plug-in Options
Once a new plug-in has been created and named, it is listed in the VectorScript Plug-in Editor dialog box. Depending on the plug-in type, other settings are made to control its associated script, execution conditions, appearance, stored and default parameters, and insertion options.
Plug-in Scripts
The script source code for the command, tool, or object can be created using the VectorScript Editor or a third-party text editor and imported into the plug-in. The source code is saved as part of the plug-in item.
To create script code:
1.
Click the Script button from the VectorScript Plug-in Editor dialog box.
2.
3.
Click OK to save the script as part of the plug-in.
Plug-in Parameters
VectorScript commands, tools, and objects can have parameter records associated with them. These records store persistent data between uses and provide default parameter values. A menu command which displays a dialog box, for example, might need to store values entered by a user for later use. A tool might provide several mode options in a popup list. Should the user wish to select a different mode for the tool, the new setting can be saved and reused on a subsequent use of the tool item. These values can be stored in the parameter record of the menu command or tool and retrieved later when the command or tool is selected again. Switching files will display stored values associated with the new files or, if no parameter record exists, will display the default values of the parameter record as created by the plug-in item.
The parameters which define the appearance of a VectorScript object are stored in a parameter record which is associated with each object instance placed in the file. The parameters for each object instance can be modified by using the Object Info palette to access the values in the object parameter record. A default parameter record is also created when the first instance of an object (or tool) is created in the active file. This default parameter record, which is distinct from the parameter records associated with object instances, stores the object default settings with the file. It is used when placing subsequent object instances to define the defaults for each new object instance.
For more information on plug-in parameters, see Plug-in Parameter Types.
To create a parameter record:
1.
Click the Parameters button from the VectorScript Plug-in Editor dialog box.
The Parameters dialog box opens.
2.
Click New to create each parameter record and its settings.
For linear objects, the LineLength parameter is displayed, which contains the axis length of the linear object. For rectangular objects, both the LineLength (the initial length of the object instance) and BoxWidth (the initial width of the object instance) parameters are displayed. New default values can be specified for these parameters, but they cannot be deleted.
For details on specific plug-in parameter types, see Parameter Types.
3.
Click OK to save the parameters.
Plug-in Properties
Property settings allow plug-ins to behave like standard VectorWorks menu commands, tools, and objects. These settings control behavior of the plug-in with respect to the state of the file (selection status, view orientation) as well as define the help text to display.
The properties available depend on the plug-in type.
Command Properties
To set properties for commands:
1.
The Command Properties dialog box opens.
2.
 
Specifies the menu command help text; help text describing the menu command displays when the cursor pauses over the command (currently, this is only available on Macintosh)
If a menu command should act only on a single selected object, for example, availability options would be set to require object selection, but prohibit multiple selection. The menu command is disabled when the drawing state does not match the indicated option settings.
3.
Click OK to save the new settings for the plug-in.
Tool Properties
To set properties for tools:
1.
The Tool Properties dialog box opens.
2.
 
Specifies the descriptive text to display for modes on the Tool bar; usually this includes the name of the tool, and it can include text indicating an action for the user to perform
The default icon can be replaced by a custom icon, if desired. With a third-party icon editor, create an 8-bit image, centered in an area 24 pixels wide by 18 pixels high. Save the icon in  .png format, and click Import PNG Icon to import it.
Determines what view projection must be active. If the required projection is not active, the user is prompted before switching the view to the correct projection.
Tools are set by default to execute immediately when selected. In some cases, however, it may be desirable to have the script execution wait for mouse movement (such as a tool which draws interactively based on user mouse movement).
3.
Click OK to save the new settings for the plug-in.
Object Properties
To set properties for objects:
1.
The Object Properties dialog box opens.
2.
 
Specifies the descriptive text to display in the Tool bar; usually this includes the name of the object, and it can include text indicating an action for the user to perform
The default icon can be replaced by a custom icon, if desired. With a third-party icon editor, create an 8-bit image, centered in an area 24 pixels wide by 18 pixels high. Save the icon in  .png format, and click Import PNG Icon to import it.
Determines what view projection must be active. If the required projection is not active, the user is prompted before switching the view to the correct projection.
Objects are set by default to execute immediately when selected. In some cases, however, it may be desirable to have the script execution wait for mouse movement (such as a tool which draws interactively based on user mouse movement).
By default, object geometry will only be recalculated if the object parameters or control points are edited. When object geometry is recalculated, file default settings for attributes such as font, text size, or line color will be reapplied to the object. If any of these settings have been modified since the object was placed or last edited, changes in the appearance of the object may occur. The default reset options allow objects to be manipulated without invoking object regeneration.
Reset Only calls object scripts for object regeneration when the object needs to regenerate itself to match the current object parameters. The script is called whenever the object parameters have changed. Additionally, for instances where it is important for the object to recalculate (for example, windows placed in a wall), the script can cause geometry to be recalculated when the object is rotated (Reset on Rotate) or moved (Reset on Move).
Alternatively, the plug-in script can become an event handler (With Script-Specified Events); scripts must then respond to a small set of application events. For samples and documentation on event handling scripts, go to www.nemetschek.net and access the Support > Customization > VectorScript > Examples area.
3.
Click OK to save the new settings for the plug-in.
Insertion Options
Objects, like symbols, can be assigned predefined insertion options for document placement. These options allow objects to properly interact with walls or other advanced VectorWorks object types. Command and tool plug-ins do not have insertion option settings.
To set insertion options for plug-in objects:
1.
The Insertion Options dialog box opens.
2.
For objects which do not require insertion options, leave the options at the default settings.

Using VectorScript Plug-ins : Plug-in Properties and Management : Plug-in Options

Nemetschek NA
Phone: 410.290.5114
Fax: 410.290.8050